<div class="modal-header">
  <div class="modal-title">{{element.id ? '编辑' : '添加'}}</div>
</div>
<form (ngSubmit)="save()" nz-form>
  <nz-form-item>
    <nz-form-label nzXs="24" nzSm="7" nzFor="code" nzRequired>资源编码</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <input nz-input [(ngModel)]="element.code" name="code" placeholder="请输入资源编码" id="code">
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzXs="24" nzSm="7" nzFor="elementType" nzRequired>资源类型</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <nz-select [nzPlaceHolder]="'请选择'" name="elementType" [(ngModel)]="element.type" nzId="elementType">
        <nz-option *ngFor="let elementType of elementTypes" [nzLabel]="elementType.text" [nzValue]="elementType.value"></nz-option>
      </nz-select>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzXs="24" nzSm="7" nzFor="name" nzRequired>资源名称</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <input nz-input [(ngModel)]="element.name" name="name" placeholder="请输入资源名称" id="name">
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzXs="24" nzSm="7" nzFor="uri" nzRequired>资源地址</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <input nz-input [(ngModel)]="element.uri" name="uri" placeholder="请输入资源名称" id="uri">
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-label nzXs="24" nzSm="7" nzFor="method" nzRequired>资源请求类型</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <nz-select [nzPlaceHolder]="'请选择'" name="method" [(ngModel)]="element.method" nzId="method">
        <nz-option *ngFor="let method of methods" [nzLabel]="method.text" [nzValue]="method.value"></nz-option>
      </nz-select>
    </nz-form-control>
  </nz-form-item>

  <div class="modal-footer">
    <button nz-button type="button" (click)="close()">关闭</button>
    <button nz-button [nzLoading]="loading" [nzType]="'primary'">保存</button>
  </div>
</form>



